package com.seckill.api.constants;

import com.seckill.common.enums.BaseEnum;
import lombok.AllArgsConstructor;
import lombok.Getter;


@Getter
@AllArgsConstructor
public enum ItemStatus implements BaseEnum {
    NO_UP_SHELF(1, "待上架"),
    SHELF(2, "已上架"),
    DOWN_SHELF(3, "下架");


    private final int value;
    private final String desc;

    public static String desc(Integer status) {
        if (status == null) {
            return "";
        }
        for (ItemStatus courseStatus : values()) {
            if (courseStatus.getValue() == status) {
                return courseStatus.getDesc();
            }
        }
        return null;
    }
}